2wirespiiso 2.2.0
Loading...
Searching...
No Matches
2-Wire SPI ISO Click Driver

API for configuring and manipulating 2-Wire SPI ISO Click driver. More...

Topics

 2-Wire SPI ISO Settings
 Settings of 2-Wire SPI ISO Click driver.
 2-Wire SPI ISO MikroBUS Map
 MikroBUS pin mapping of 2-Wire SPI ISO Click driver.

Functions

void c2wirespiiso_cfg_setup (c2wirespiiso_cfg_t *cfg)
 2-Wire SPI ISO configuration object setup function.
err_t c2wirespiiso_init (c2wirespiiso_t *ctx, c2wirespiiso_cfg_t *cfg)
 2-Wire SPI ISO initialization function.
void c2wirespiiso_default_cfg (c2wirespiiso_t *ctx)
 2-Wire SPI ISO default configuration function.
err_t c2wirespiiso_write (c2wirespiiso_t *ctx, uint8_t *data_in, uint8_t in_len)
 2-Wire SPI ISO write function.
err_t c2wirespiiso_read (c2wirespiiso_t *ctx, uint8_t *data_out, uint8_t out_len)
 2-Wire SPI ISO read function.
err_t c2wirespiiso_write_then_read (c2wirespiiso_t *ctx, uint8_t *data_in, uint8_t in_len, uint8_t *data_out, uint8_t out_len)
 2-Wire SPI ISO write then read function.
void c2wirespiiso_disable_device (c2wirespiiso_t *ctx)
 2-Wire SPI ISO disable device function.
void c2wirespiiso_enable_device (c2wirespiiso_t *ctx)
 2-Wire SPI ISO enable device function.
void c2wirespiiso_disable_tx (c2wirespiiso_t *ctx)
 2-Wire SPI ISO disable tx function.
void c2wirespiiso_enable_tx (c2wirespiiso_t *ctx)
 2-Wire SPI ISO enable tx function.
uint8_t c2wirespiiso_get_bne_pin (c2wirespiiso_t *ctx)
 2-Wire SPI ISO get bne pin function.

Detailed Description

API for configuring and manipulating 2-Wire SPI ISO Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ c2wirespiiso_cfg_setup()

void c2wirespiiso_cfg_setup ( c2wirespiiso_cfg_t * cfg)

2-Wire SPI ISO configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See c2wirespiiso_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ c2wirespiiso_default_cfg()

void c2wirespiiso_default_cfg ( c2wirespiiso_t * ctx)

2-Wire SPI ISO default configuration function.

This function executes a default configuration of 2-Wire SPI ISO Click board.

Parameters
[in]ctx: Click context object. See c2wirespiiso_t object definition for detailed explanation.
Returns
None.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ c2wirespiiso_disable_device()

void c2wirespiiso_disable_device ( c2wirespiiso_t * ctx)

2-Wire SPI ISO disable device function.

This function disables the device by setting the DIS pin to HIGH logic state.

Parameters
[in]ctx: Click context object. See c2wirespiiso_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ c2wirespiiso_disable_tx()

void c2wirespiiso_disable_tx ( c2wirespiiso_t * ctx)

2-Wire SPI ISO disable tx function.

This function disables the transmitter by setting the TXEN pin to LOW logic state.

Parameters
[in]ctx: Click context object. See c2wirespiiso_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ c2wirespiiso_enable_device()

void c2wirespiiso_enable_device ( c2wirespiiso_t * ctx)

2-Wire SPI ISO enable device function.

This function enables the device by setting the DIS pin to LOW logic state.

Parameters
[in]ctx: Click context object. See c2wirespiiso_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ c2wirespiiso_enable_tx()

void c2wirespiiso_enable_tx ( c2wirespiiso_t * ctx)

2-Wire SPI ISO enable tx function.

This function enables the transmitter by setting the TXEN pin to HIGH logic state.

Parameters
[in]ctx: Click context object. See c2wirespiiso_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ c2wirespiiso_get_bne_pin()

uint8_t c2wirespiiso_get_bne_pin ( c2wirespiiso_t * ctx)

2-Wire SPI ISO get bne pin function.

This function returns the RX buffer not empty (BNE) pin logic state.

Parameters
[in]ctx: Click context object. See c2wirespiiso_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ c2wirespiiso_init()

err_t c2wirespiiso_init ( c2wirespiiso_t * ctx,
c2wirespiiso_cfg_t * cfg )

2-Wire SPI ISO initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See c2wirespiiso_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See c2wirespiiso_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c2wirespiiso_read()

err_t c2wirespiiso_read ( c2wirespiiso_t * ctx,
uint8_t * data_out,
uint8_t out_len )

2-Wire SPI ISO read function.

This function reads a desired number of data bytes by using SPI serial interface.

Parameters
[in]ctx: Click context object. See c2wirespiiso_t object definition for detailed explanation.
[out]data_out: Output read data.
[in]out_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c2wirespiiso_write()

err_t c2wirespiiso_write ( c2wirespiiso_t * ctx,
uint8_t * data_in,
uint8_t in_len )

2-Wire SPI ISO write function.

This function writes a desired number of data bytes by using SPI serial interface.

Parameters
[in]ctx: Click context object. See c2wirespiiso_t object definition for detailed explanation.
[in]data_in: Data to be written.
[in]in_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c2wirespiiso_write_then_read()

err_t c2wirespiiso_write_then_read ( c2wirespiiso_t * ctx,
uint8_t * data_in,
uint8_t in_len,
uint8_t * data_out,
uint8_t out_len )

2-Wire SPI ISO write then read function.

This function writes and then reads a desired number of data bytes by using SPI serial interface.

Parameters
[in]ctx: Click context object. See c2wirespiiso_t object definition for detailed explanation.
[in]data_in: Data to be written.
[in]in_len: Number of bytes to be written.
[out]data_out: Output read data.
[in]out_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.